<?php
require_once '../include/functions.php';
//set session save path
session_save_path($session_path);
// Initialize a session. 
session_start();
$count++;
$start = time();
$sessionId = session_id();
//Connect To Database
dbConnect();

//Get this week
$CurrWeek = getWeek("NFL");
//Write SQL Query to extract specified data
if($CurrWeek > 17)
{
	//$SQL = "SELECT ID, username, Score, Rank, PrevRank, PicksMade, PlayOffs, (Score/PicksMade) AS Percentage FROM NFLUsers WHERE (PlayOffs=1 AND flag=1 AND PicksMade > 0) ORDER BY Percentage DESC, Score DESC, Rank ASC, username ASC";
	$SQL = "SELECT ID, username, Score, Rank, PrevRank, PicksMade, PlayOffs, (Score/PicksMade) AS Percentage FROM NFLUsers WHERE (PlayOffs=1 AND flag=1) ORDER BY Percentage DESC, Score DESC, Rank ASC, username ASC";
}
else
{
	$SQL = "SELECT ID, username, Score, Rank, PrevRank, PicksMade, ROUND((Score/PicksMade)*100,2) AS Percentage FROM NFLUsers WHERE (flag=1 AND PicksMade > 0) ORDER BY Percentage DESC, Score DESC, Rank ASC, username ASC";
}
//Open Record Set using SQL Query
$result = mysql_query($SQL) or die("Cannot query the database.<br>" . mysql_error());

?>	
Looking for ALL the standings?  See the 2007 regular season standings in the <a href="history/2007/index.php" class="permLink">2007 history page</a>.
<br/>
<br/>
<table width="550" cellpadding="5" cellspacing="0">
	<tr>
		<td align="center" class="redbg" height="1"><span class="whitelink">Playoff Standings by Percentage</span></td>
	</tr>
	<tr>
		<td class="redbg">
		<table width="100%" cellspacing="0" cellpadding="3" border="0" align="center">
		<tr bgcolor="#FFFFFF">
			<TH width="5%">&nbsp;</TH>
			<TH width="30%" align="left">UserName</TH>
			<TH width="20%" align="left">%</TH>
			<TH width="20%" align="left">Score</TH>
			<TH width="25%" align="left"># Picks Made</TH>
		</tr>
		<tr bgcolor="#FFFFFF"><td colspan="5"><hr color="#cd0000" size="1"></td></tr>
		<?
		$num = 0;
		do{
			if (($myrow["username"] != Null) || ($myrow["username"] != ""))
			{
				$num++;
				if ($userID && ($userID == $myrow["ID"]))
					echo "<tr bgcolor=\"#ffff33\">";
				else
					echo "<tr bgcolor=\"".getRowColor($num)."\">";
				echo "<td>&nbsp;</td><td valign=\"center\"><B>".makeUserLink($myrow["ID"])."</B></td><td>".$myrow["Percentage"]." %</td><td>".$myrow["Score"]."</td><td>".$myrow["PicksMade"]."</td></tr>";
			}
		}while($myrow = mysql_fetch_array($result));

		?>
	<tr bgcolor="#FFFFFF"><td colspan="5">&nbsp;</td></tr></table></td></tr>
</table>